package com.OnTimeTeam.OnTime;
import java.util.ArrayList;

import com.OnTimeTeam.OnTime.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;


public class PrefLVAdapter extends ArrayAdapter<Boolean> {

	private ArrayList<Boolean> items; //all alarms details

	
	//CTOR - init' the array of AlarmFeatures and ApplicationContext object
	public PrefLVAdapter(Context context, int textViewResourceId, ArrayList<Boolean> items) {
		super(context, textViewResourceId, items);
		this.items = items;

	}
	
	public View getView(final int index, View convertView, ViewGroup parent) {
		
		View view = convertView;
		LayoutInflater inflater = null;
		
		if (view == null) {
			inflater = (LayoutInflater)this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			view = inflater.inflate(R.layout.pref_item, null);//set the view
		}
		
		TextView entry = (TextView)view.findViewById(R.id.entry);
		 
		switch(index){
			case 0://Set time
				entry.setText(getContext().getResources().getString(R.string.defaultAlarmSettings));
				break;
			case 1:
				entry.setText(getContext().getResources().getString(R.string.infoManager));
				break;			
			case 2:
				entry.setText(getContext().getResources().getString(R.string.rateUs));
				break;
		}//end cases
		
		//return the view of the item
		return view;
	
	}//end of method 'getView'
	
}
